2

I am having a problem with my inline css. So, I am trying to add a border under the data rendered from the database. The problem is the rendered data is under the name, the How can I move the border-bottom and the rendered data at the right of the word "Name"?

here's the html code

<table style="border:none;border-collapse: collapse;font-size:12px;text-align: left;">
<tr>
    <td colspan="3"><b>I.  PERSONAL AND FAMILY DATA</b></td><td colspan="2"><b>Date today</b> <u>{{ \Carbon\Carbon::parse($infomodel->date_last_updated)->format('m-d-Y') }}</u></td>
</tr>
<tr >
    <td colspan="3"><b>Name </b><div style="border-bottom:.7px solid black;height:15px;padding:0px;width:290px;overflow:hidden;">{!! $usermodel->last_name !!}, {!! $usermodel->first_name!!} {!! $usermodel->middle_name !!}.
      </div>
      </td>
    <td colspan="2"><b>Sex </b><u>{!! $infomodel->gender !!}</u></td>
</tr>
<tr>
    <td colspan="5"><b>Home Address </b><div  style="border-bottom:.7px solid black;height:15px;padding:0px;width:450px;overflow:hidden;">{!! $infomodel->mailing_address !!}
        
        </div>
    </td>
</tr>
</table><br />

Here is the pdf view

enter image description here

2
  • you mean inline? Commented Jan 30, 2023 at 9:56
  • yes, i edited the code to its original format, please see the attached picture for reference. thanks Commented Jan 30, 2023 at 10:01

1 Answer 1

3

Print the output in the styled element. And make the element to an inline element.

Example: Change this :

<td colspan="3"><b>Name </b><div style="border-bottom:.7px solid black;height:15px;padding:0px;width:290px;overflow:hidden;">{!! $usermodel->last_name !!}, {!! $usermodel->first_name!!} {!! $usermodel->middle_name !!}.
      </div>
      </td>

to this:

<td colspan="3"><b>Name </b>
    <div style="display: inline; border-bottom:.7px solid black;height:15px;padding:0px;width:290px;overflow:hidden;">{!! $usermodel->last_name !!}, {!! $usermodel->first_name!!} {!! $usermodel->middle_name !!}.
    </div>
</td>

<table style="border:none;border-collapse: collapse;font-size:12px;text-align: left;">
<tr>
    <td colspan="3"><b>I.  PERSONAL AND FAMILY DATA</b></td><td colspan="2"><b>Date today</b> <u>{{ \Carbon\Carbon::parse($infomodel->date_last_updated)->format('m-d-Y') }}</u></td>
</tr>
<tr >
    <td colspan="3"><b>Name </b><div style="display: inline; border-bottom:.7px solid black;height:10px;padding:0px;width:290px;overflow:hidden;">
    {!! $usermodel->last_name !!}, {!! $usermodel->first_name!!} {!! $usermodel->middle_name !!}.
      </div>
      </td>
    <td colspan="2"><b>Sex </b><u>{!! $infomodel->gender !!}</u></td>
</tr>
<tr>
    <td colspan="5"><b>Home Address </b>{!! $infomodel->mailing_address !!}
        <div  style="border-bottom:.7px solid black;height:15px;padding:0px;width:450px;overflow:hidden;">
        </div>
    </td>
</tr>
</table><br />

Sign up to request clarification or add additional context in comments.

3 Comments

i really need to use div because i need the border to show, since theres a lot of data with blank spaces im working with, it is really necessary to display the border-bottom
@CaptainCRAZY No proble. Then you add to the div style this css property: display: inline; . I updated my code in my answer.
@CaptainCRAZY You welcome! If it works, would be nice that you can accept this answer. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.