Problem styling td server side processing

Am trying to customize my server side processing td
am doing the below, but the problem results still on same line even if i try to break them down to next line its not working p tag not working to bring results to next line

rowCallback: function (row, data) {
$('td:eq(0)', row).html('<p><span class="imfm"> ' + data[1] + '</span></p>');
$('td:eq(1)', row).hide();
$('td:eq(2)', row).html('<p> ' + data[2] + ' </p>');
$('td:eq(3)', row).hide();
}

You’re running jQuery on your server?

Yes @Gandalf, because everything is ok. the data is coming very well. the problem i have tried to style the data but even if i put p tag to move some info to next line. it doesn’t work. the info remains on same like

info info info info

yet i want

info
info 
info 
info

I don’t use jquery, but presumably you are putting content into table cells. The layout of your output is going to be dictated by the table. Apart from maybe margins (space), the paragraphs aren’t going to make a difference.

e.g.
If these table cells are styled to display horizontally in a row

<tr>
  <td>Alfreds Futterkiste</td>
  <td>Maria Anders</td>
  <td>Germany</td>
</tr>

Putting paragraphs here isn’t going to change that.

<tr>
  <td><p>Alfreds Futterkiste</p></td>
  <td><p>Maria Anders<p></td>
  <td><p>Germany</p></td>
</tr>

Example

Putting something like

tr {
  display: flex;
  flex-direction: column;
}

Seems to force to rows, but the person posting next would be better to advise :slight_smile:

2 Likes

You’d need to set the td (and th if any) to display: block to stop it behaving like a table-cell.

e.g.

td,th{
  display:block;
}

Of course that breaks any table like structure and won’t match headings.

2 Likes

That would work also :slight_smile:

thanks this has worked for me

1 Like