JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<div>
<table class="mytable">
<tr>
<th>ABC</th>
<th>DEF</th>
</tr>
</table>
</div>
<div class="container2">
<span class="question">What is your Name</span>
<span class="answer">Sunil Garg</span>
</div>
</div>
CSS
.container {
display: flex;
flex-direction: column;
border: 1px solid red;
vertical-align:middle;
}
.mytable {
width: 100%
}
table,
th,
td {
border: 1px solid black;
}
.container2 {
margin: 0em 0 0;
display: flex;
max-width: 30%;
text-align: center;
height:5
}
.question {
padding: 5px 20px;
line-height: 20px;
font-size: 14px;
min-width: 50%;
background-color: green;
border: 1px solid rgba(27, 31, 35, 0.2);
border-top-left-radius: 18px;
border-bottom-left-radius: 18px;
color: white;
}
.answer {
background-color: blue;
padding: 5px 20px;
line-height: 20px;
font-size: 14px;
min-width: 50%;
border: 1px solid rgba(27, 31, 35, 0.2);
border-top-right-radius: 18px;
border-bottom-right-radius: 18px;
color: white;
}