Apply a style to paragraphs

Apply a style to paragraphs

classic12classic12 Posts: 228Questions: 60Answers: 4

Hi Guys,

I am trying to use the following to format some text stored in a database.

render: function(data, type, row)
          {

              return  '<h1 style="font-family: Helvetica,Verdana,Geneva,sans-serif ; font-size:calc(14px + 2.5vw)">' + data.title +'</h1>' + 'p {font-size: calc(11px + 2vw);font-family: Helvetica,Verdana,Geneva,sans-serif;}' +data.url  + '</p>';

          }

I am editing the text in CKEditor so my stored text (data.url) is as follows:

<p>edited in CKEditor</p>

<p>This is my text for the description in the news.<br />


another line</p>

<p>sdfsdfa</p>

<p><br />
asdfasdf</p>

The data.title section works okay as this is just text.

Can I apply the 'font-size: calc(11px + 2vw)' to all the paragraphs ?

Cheers

Steve Warby

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin
    Answer ✓

    I don't see why not. table.dataTable td p { font-size: calc(11px + 2vw); } should do it in your CSS.

    Allan

This discussion has been closed.