[ANSWERED] html – concatenate

Solution 1 :

You can add css like below. Update your dt and dd width as per your requirement.

There may apply some default margin to these elements so it may possible that if you make widht sum 100% then it will display dd on next line.

dt {
  width: 30%;
  display: inline-block;

dd {
  width: 60%;
  display: inline-block;
  margin: 0px;
<div style="margin-left:100px">
    <hr />
    <dl class="horizontal">

Problem :

I want to create page header and i need to concatenate dt and dd in one line
This is my view code :

<div style="margin-left:100px">
    <hr />
    <dl class="horizontal">
        <dt>@Html.DisplayNameFor(model => model.labCashView.Patient_Name)</dt> 
        <dd>@Html.DisplayFor(model => model.FirstOrDefault().labCashView.Patient_Name)</dd>
        <dt>@Html.DisplayNameFor(model => model.labCashView.Patient_No)</dt> 
        <dd>@Html.DisplayFor(model => model.FirstOrDefault().labCashView.Patient_No)</dd> 
        <dt>@Html.DisplayNameFor(model => model.labCashView.SEX)</dt> 
        <dd>@Html.DisplayFor(model => model.FirstOrDefault().labCashView.SEX)</dd>
        <dt>@Html.DisplayNameFor(model => model.labCashView.AGE)</dt>  
        <dd>@Html.DisplayFor(model => model.FirstOrDefault().labCashView.AGE)</dd>
        <dt>@Html.DisplayNameFor(model => model.labCashView.order_number)</dt>  
        <dd>@Html.DisplayFor(model => model.FirstOrDefault().labCashView.order_number)</dd>


The output now the title in one line and data in the second line :


Sami Ali



But I need the output like this :

Patient_Name Sami Ali

Patient_No 345676

and so on, How can I do it?