JSFiddle - React, Tailwind, and code Playground

by core972

HTML

<script src="https://code.jquery.com/jquery-3.4.1.slim.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css">
<!-- 
  Bootstrap docs: https://getbootstrap.com/docs
-->

<div class="container">
  <div class="row">
    <!-- TABLE 1 -->
    <div class="col-md-6 col-sm-12 col-xs-12">
      <table>
        <thead>
          <th class="table-header" colspan="3">Model Inputs, Internal Combustion Engine</th>
        </thead>
        <!--
                        Structure of table row: 
                        Title | value | units
                    -->
        <tr class="indent-0">
          <td>Vehicle Life</td>
          <td><input name="G18_Car" value="{{data['G18_Car']}}"></td>
          <td class="units">Years</td>
        </tr>
        <tr class="indent-0">
          <td>Distance Traveled Per Year After Purchase</td>
          <td><input name="G19_Car" value="{{data['G19_Car']}}"></td>
          <td class="units">Miles</td>
        </tr>
        <!--Generation, Assembly, and Delivery-->
        <th class="big-header indent-0">Manufacture, Assembly, and Delivery</th>
        <tr class="indent-6">
          <td>Manufacture Assembly - GHG Emissions</td>
          <td><input name="G22_Car" value="{{data['G22_Car']}}"></td>
          <td class="units">MT CO2e</td>
        </tr>
        <tr class="indent-6">
          <td>Delivery - GHG Emissions</td>
          <td><input name="G23_Car" value="{{data['G23_Car']}}"></td>
          <td class="units">MT CO2e</td>
        </tr>
        <!--Operation and Disposal-->
        <tr>
          <th class="big-header indent-0">Operation and Disposal</th>
        </tr>
       ...

CSS

/* TABLE CLASSES */
.units{
    text-align: left;
}

.table-header{
    font-size: 20px;
    text-align: center;
    border-bottom: 2px solid black;
}

.big-header{
    font-size: 16px;
}

.small-header{
    font-size: 16px;
}

/* 
Nest table based on these values
Indent 0" 6" 12" or 18", based off of excel indentations
*/

.indent-0 td:first-child, th.indent-0 {
    padding: 10px;
    padding-left: 10px;
}
.indent-6 td:first-child, th.indent-6 {
    padding: 10px;
    padding-left: 3%;
}
.indent-12 td:first-child, th.indent-12 {
    padding: 10px;
    padding-left: 6%;
}
.indent-18 td:first-child, th.indent-18 {
    padding: 10px;
    padding-left: 9%;
}