Using \x0A worked for me to get newline in title/tooltip on mouse hover.
FILENAME: news.php
<span onmouseover="getInfo(this,'06-APR-22')" data-html="true">Day</span>
FILENAME: news.php
<script>
function getInfo(x, dateVal) {
var html = $.ajax({
type: "POST",
url: "report/get-info.php",
data: {
'dateVal': dateVal,
},
success: function(response) {
x.setAttribute('title', response );
}
});
}
</script>
FILENAME: get-info.php
<?php
$tmp = $_POST['dateVal'];
$dateVal = date("m/d/Y", strtotime($tmp));
$querySelectCode = "SELECT INFO_ID, INFO_NAME FROM INFORMATION
WHERE TRUNC(DP.DATE_TIME) = TO_DATE('$dateVal','MM/DD/YYYY') ";
$stmtSelectcode = oci_parse($dbConn, $querySelectCode);
if ( ! oci_execute($stmtSelectcode) ){
$err = oci_error($stmtSelectcode);
trigger_error('Query failed: ' . $err['message'], E_USER_ERROR);
}
$INFO_ID = array();
while(oci_fetch($stmtSelectcode)){
$INFO_ID[] = oci_result($stmtSelectcode, 'INFO_ID');
$INFO_NAME[] = oci_result($stmtSelectcode, 'INFO_NAME');
}
for($index=0 ; $index < count($INFO_ID) ; $index++)
{
echo $INFO_NAME[$index ] . "\x0A" ;
}
?>
. Then put spaces where you want the line breaks. You may also need to add a bunch of
characters before your space (line break). – Harmon