how to create a custom tooltip using title attribute without jquery

Developer52

I want to create a tooltip as shown in pic. Value in title tag is coming from controller. enter image description here

This is my table code:

<table border="1" cellpadding="10">
  <tbody style="white-space: nowrap;">
    <tr ng-repeat="row in rows">
      <td style="width: 2%;">
        <input type="checkbox" 
               ng-model="tableSelection[$index]"
               style="margin-left: 10px;">
      </td>
      <td style="font-size: smaller; width: 27%; color: gray; white-space: nowrap;"
          ng-repeat="col in input_columns"
          droppable="dropable"
          drop-fn="drop"
          drop-index="$index"
          drop-data="col"
          title=""
          ng-click="openDialog($event,$index)"
          tempValue="">&lt;enter data&gt;</td>

      <td style="font-size: smaller; width: 27%; color: gray; white-space: nowrap;"
          ng-repeat="col in output_columns"
          droppable="dropable"
          drop-fn="dropOutput"
          drop-index="$index"
          drop-data="col"
          title=""
          ng-click="openDialogOutputConst($event,$index)">&lt;enter data&gt;</td>
    </tr>
  </tbody>
</table>

Can anyone help me how to provide a tooltip like this.

NiZa

Something like this?

td {
  position: relative;
}

td:hover:before {
  content: attr(data-title);
  position: absolute;
  background-color: yellow;
  top: 100%;
  width: 200px;
  white-space: normal;
  word-spacing: 200px; 
}
<table border="1" cellpadding="10">
  <tbody style="white-space: nowrap;">
    <tr ng-repeat="row in rows">
      <td style="width: 2%;">
        <input type="checkbox" ng-model="tableSelection[$index]" style="margin-left: 10px;">
      </td>
      <td style="font-size: smaller; width: 27%; color: gray; white-space: nowrap;" ng-repeat="col in input_columns" droppable="dropable" drop-fn="drop" drop-index="$index" drop-data="col" data-title="Idaho Illinois Indiana Iowa Kansas Missouri Nebraska Ohio"
      ng-click="openDialog($event,$index)" tempValue="">&lt;enter data&gt;</td>

      <td style="font-size: smaller; width: 27%; color: gray; white-space: nowrap;" ng-repeat="col in output_columns" droppable="dropable" drop-fn="dropOutput" drop-index="$index" drop-data="col" data-title="Some text here" ng-click="openDialogOutputConst($event,$index)">&lt;enter data&gt;</td>
    </tr>
  </tbody>
</table>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Access bootstrap tooltip title attribute using jquery

Changing tooltip title using jQuery

jquery tooltip from html title attribute

How to prevent title attribute from showing tooltip?

How to remove tooltip but keep the 'title' attribute value

Changing content of a HTML element's 'title' attribute used for tooltip, using jquery or css

How to create a custom SWT Tooltip using JFACE for an RCP MDirectToolItem?

How do I display tooltip text for HTML <input> element using CSS style and data-title attribute?

How to call an attribute without using id in Jquery?

jQuery UI Tooltip should show Div instead of title attribute

How to change an element's title attribute using jQuery

How to get the Image "title" attribute value into another element using jQuery

How to add title of element to class attribute using jquery

Bootstrap 4 tooltip use custom attribute other than title to provide the text for the tooltip

Change how fast "title" attribute's tooltip appears

How to create a spacing before a title in Bulma, without using a content container

How to create a DialogFragment without title?

Create "title" attribute using the text inside <a> tag?

How to write a custom factory attribute without using the generate function

how to show tooltip using jquery

How can I create a custom JSchemaGenerationProvider that adds a title attribute to both the model and to the model's properties?

How to create callback in custom function using jquery

How to use the attribute "title" without relying on "pattern"?

How to pass a custom component to title props in MUI tooltip?

if/else jQuery using custom attribute

How to display a tooltip in Jquery with custom div elements

How to verify if a certain value is present in a custom attribute using javascript or jquery?

How to refer My own custom attribute using jQuery

How to get the value of custom HTML attribute using JQuery?