Short codes should not echo/print but rather return. Copy paste this code into a code snippet and change the CSS/Php for your project.
function mc_topics_list()
{
$terms = get_terms( array(
'taxonomy' => 'topic',
'hide_empty' => false,
) );
if($terms)
{
$return = '';
foreach($terms as $key => $term)
{
$link = get_term_link($term);
$return .= '<div class="grid-50 tablet-grid-50 mobile-grid-100">';
$return .= '<a href="' . esc_url($url) .'" title="' . esc_attr($title) . '"></a>';
$return .= '<a href="' . $link . '">' . $term->name . '</a>';
$return .= '</div>';
}
}
return $return;
}
add_shortcode('mc-topics', 'mc_topics_list');